package gamegui;

import javax.swing.JPanel;

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
import java.awt.Dimension;
import java.awt.Point;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JPasswordField;
import javax.swing.JTextField;

public class ViewRegister extends JPanel{
    private final JTextField signInField;// = new JTextField();
    private final JPasswordField passField;// = new JPasswordField();
    private final JButton registerButton;
    private final JButton quitButton;
    
    public ViewRegister(){
        // Variables
        final Dimension signInSize = new Dimension (400, 40);
        final Dimension passSize = new Dimension (400, 40);
        final Dimension regButSize = new Dimension (140, 60);
        final Dimension quitButSize = new Dimension (140, 60);
        final Point signInLoc = new Point(390, 415);
        final Point passLoc = new Point(390, 470);
        final Point quitButLoc = new Point(850, 600);
        final Point regButLoc = new Point(520, 625);
        
        // Panel Initialization
        ImageIcon signInImage = new ImageIcon("register.jpg");
        JLabel label;
        label = new JLabel("", signInImage, JLabel.CENTER);
        label.setLocation(0, 0);
        
        //Sign in field
        signInField = new JTextField();
        signInField.setLocation(signInLoc);
        signInField.setSize(signInSize);
        signInField.setBorder(null);
        label.add(signInField);
        
        // Password Field
        passField = new JPasswordField();
        passField.setLocation(passLoc);
        passField.setSize(passSize);
        passField.setBorder(null);
        label.add(passField);
        
        
        //Register Button
        registerButton = new JButton("Register");
        registerButton.setLocation(regButLoc);
        registerButton.setSize(regButSize);
        label.add(registerButton);
        
        quitButton = new JButton("Back");
        quitButton.setLocation(quitButLoc);
        quitButton.setSize(quitButSize);
        label.add(quitButton);
        
        add(label);
        repaint();
    }
    /*
    *   Getters
    */
  
    public JButton getRegisterButton(){
        return registerButton;
    }
    public JButton getBackToMainButton(){
    	return quitButton;
    }
    public String getUsername(){
        return signInField.getText();
    }
    
    public String getPassword(){
        return passField.getText();
    }
}
